<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root">
        <!-- 遍历数组 -->
        <ul>
            <li v-for="item in arr" :key="item.id">
                我是:{{item.name}} --- 我{{item.age}}岁了
            </li>
        </ul>

        <!-- 遍历对象 -->
        <ul>
            <li v-for="(value,key) in obj">
                {{key}} : {{value}}
            </li>
        </ul>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        new Vue({
            el: '#root',
            data: {
                arr: [
                    {id: 1,name: '张三',age: 12},
                    {id: 2,name: '李四',age: 64},
                    {id: 3,name: '王五',age: 34}
                ],
                obj: {name: 'HuangWenhao',age: 22}

            }
        })
    </script>
</body>
</html>